package com.chinamsp.zookeeper;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * 配置
 * @author shifenghu
 * @version 1.0
 */
@ConfigurationProperties(prefix = ZookeeperFactoryBean.PROPERTIES_PREFIX)
@Configuration
public class ZookeeperProperties {

	/**
	 * zookepper 链接 地址
	 */
	private String address = "127.0.0.1:2181";
	
	/**
	 * 自动启动
	 */
	private boolean autoStart = false;
	
	/**
	 * 初始等待时间，单位 ms
	 */
	private int baseSleepTimeMs = 200;
	
	/**
	 * 最大等待时间，单位ms
	 */
	private int maxSleepTimeMs = 2000;
	
	/**
	 * 重试次数 
	 */
	private int maxRetries = 5;

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public boolean isAutoStart() {
		return autoStart;
	}

	public void setAutoStart(boolean autoStart) {
		this.autoStart = autoStart;
	}

	public int getBaseSleepTimeMs() {
		return baseSleepTimeMs;
	}

	public void setBaseSleepTimeMs(int baseSleepTimeMs) {
		this.baseSleepTimeMs = baseSleepTimeMs;
	}

	public int getMaxSleepTimeMs() {
		return maxSleepTimeMs;
	}

	public void setMaxSleepTimeMs(int maxSleepTimeMs) {
		this.maxSleepTimeMs = maxSleepTimeMs;
	}

	public int getMaxRetries() {
		return maxRetries;
	}

	public void setMaxRetries(int maxRetries) {
		this.maxRetries = maxRetries;
	}
	
	
}
